Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link against system-cxx-std-lib for GHC 9.4+ #197

Merged
merged 2 commits into from
Feb 23, 2024

Conversation

jship
Copy link
Contributor

@jship jship commented Feb 21, 2024

When testing a Windows application using dear-imgui and file-embed with GHC 9.4.8, I bumped into this build issue:

<no location info>: error:
    addDLL: stdc++ or dependencies not loaded. (Win32 error 126)

The same application worked fine on Mac and I'm not yet familiar enough with Windows development to understand why the Windows side wasn't happy. Regardless, following the recommendation in the linked issue and the GHC 9.4 migration guide to link against the virtual system-cxx-std-lib instead of stdc++ for 9.4+ gets things working on Windows and the Mac build continues to work.


Unrelated to this PR's changes, but I also hit the error described in #58 when trying to get the Windows build working. I'm assuming this is a problem with stack's behavior on Windows, where it seemingly does not fetch the imgui submodule. stack does get the submodule on Mac without issue. I worked around this on Windows for now by depending on a local copy of dear-imgui that had the submodule contents manually fetched.

Ideally the issue in stack will get resolved and it's something I'd like to look at time-permitting, but as food for thought, I wonder if friction would be reduced in the long run if this repo included a copy of the ImGui source rather than submoduling it in.

dear-imgui.cabal Outdated Show resolved Hide resolved
@dpwiz dpwiz merged commit b48ef79 into haskell-game:main Feb 23, 2024
1 check passed
@jship jship deleted the ghc-9.4-win branch February 23, 2024 15:02
@jship
Copy link
Contributor Author

jship commented Mar 6, 2024

Unrelated to this PR's changes, but I also hit the error described in #58 when trying to get the Windows build working. I'm assuming this is a problem with stack's behavior on Windows, where it seemingly does not fetch the imgui submodule. stack does get the submodule on Mac without issue. I worked around this on Windows for now by depending on a local copy of dear-imgui that had the submodule contents manually fetched.

This issue was fixed by commercialhaskell/pantry#131, which was included in stack in commercialhaskell/stack#6495. The next stack release will have that patch, so any stack versions following the current latest (2.15.1) should be good to go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants